package 第一题;

public class TestDemo {

	// Thread.sleep() 会抛出 InterruptedException 异常
	// 当前在方法声明处添加 throws InterruptedException 不处理
	public static void main(String[] args) throws InterruptedException 
	{
		
		Baby b = new Baby();
		Robot r = new Robot();
		b.feedMan = r;

		while(b.isAlive())
		{
			// 饥饿度增加
			b.setHungry(b.getHungry()+10);
			System.out.println("婴儿的饥饿度:"+b.getHungry());
			
			// 等待500ms
			Thread.sleep(500);
		}
		

	}

}
